7.3 Plotting points and line segments
The value of a two-element vector, single-angle radial or complex number determines a point in two-dimensional space; the value of a three-element vector or a two-angle radial determines a location in 3-dimensional space. For the purposes of plotting, a tuple of scalars is treated like a vector.
When plotted, a single point defines a position vector; a pair of points (a sequence of two points) defines a line segment; and a sequence of n points defines a sequence of n-1 line segments. A sequence is represented by a tuple-of-points expression. The sequence can be a tuple value or an iterable tuple generator.
Position vectors and point sequences are drawn differently by the plotter. A position vector is drawn as a line from the origin to the point represented by the position. Point sequences are plotted as straight lines between the points.
Here are some examples of values that can be displayed by the plotter.
(1)
(2)
(3)
(4)
in the presence of
(5)
(6)
(7)
Expressions (2) and (7) plot position vectors. Having no order, elements of sets cannot be considered as sequential. They must be treated as single points and hence as position vectors.
Expressions (3), (4) and (6) display the same plot. The expression in (4) is incomplete. Expression (5) has to be present in the plotter to complete the binding for (4). In contrast, (6) is self defining.
Expression (5) has the role of an
Expression (6) is a
Plotting point sequences closely approximates mathematical notion of parametric equations. Refer to §7.5 for more information on plotting parametric expressions and see §7.6 for more information on plotting with tuple generators.